package com.weipai.education.mapper;

import com.weipai.education.model.Inventory;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface InventoryMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Inventory record);

    int insertSelective(Inventory record);

    Inventory selectByPrimaryKey(Integer id);

    Inventory getInventoryIn(Integer productId);

    int updateByPrimaryKeySelective(Inventory record);

    int updateByPrimaryKey(Inventory record);

    List<Map<String,Object>> list(@Param("start") Integer start, 
                                  @Param("end") Integer size, 
                                  @Param("spuNumber") String spuNumber, 
                                  @Param("key") String key, 
                                  @Param("userId") String userId);

    Integer listAmount(@Param("spuNumber") String spuNumber, 
                       @Param("key") String key, 
                       @Param("userId") String userId);
    
    Inventory getInventory(@Param("userId") String userId, @Param("productId") String productId);
    
}